Skip to content

feat(codex): publish verified routed service tiers - #1521

Draft
Yuxin-Qiao wants to merge 4 commits into
lidge-jun:devfrom
Yuxin-Qiao:codex/fix-1436-service-tier
Draft

feat(codex): publish verified routed service tiers#1521
Yuxin-Qiao wants to merge 4 commits into
lidge-jun:devfrom
Yuxin-Qiao:codex/fix-1436-service-tier

Conversation

@Yuxin-Qiao

@Yuxin-Qiao Yuxin-Qiao commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Publish provider/model service-tier capability only when the exact resolved model is declared capable and its final adapter can forward the standard service_tier field.
  • Preserve explicit caller-selected service tiers for supported routes, strip them fail-closed for explicit provider/model denial or a final non-service-tier adapter, and keep unclassified OpenAI-compatible gateways caller-preserving without Fast injection.
  • Keep provider-level false authoritative over exact-model true; retain exact provider-scoped resolution in catalog metadata, combo intersections, custom-model projection, and management validation/DTO projection.
  • The previous protected auth-cors.ts scope split remains intact; the final runtime gate is isolated in the Responses normalization path.
  • Rebased onto current dev@567a6d4ffe6a7d7b341b5cc11e736081e1bb4522; current head: b1bebc059482f06b9e1e8be3aeaf2bb7902b1685.

Refs #1436
Refs #1504
Refs #1512

Verification

  • Runtime capability matrix — 19 passed, 0 failed, 45 assertions: tests/service-tier-capability.test.ts.
  • Catalog/combo matrix — 174 passed, 0 failed, 779 assertions: tests/codex-catalog.test.ts.
  • Management service-tier validation/projection — 1 passed, 0 failed, 4 assertions: the service-tier case in tests/management-provider-validation.test.ts.
  • The six review boundaries are covered: final adapter gating, exact provider/model identity, provider-level false precedence, unclassified caller preservation, provider-local PATCH merge/clear, and all-members combo intersection.
  • bun test --isolate --max-concurrency 1 --timeout 15000 tests/service-tier-capability.test.ts tests/openai-chat-hardening.test.ts — 56 passed, 0 failed, 100 assertions after rebase.
  • bun run typecheck — passed.
  • bun run privacy:scan — passed.
  • git diff --check origin/dev...HEAD — passed.
  • GitHub hygiene, target, label, and resolve checks — passed on the exact head.
  • The repository-wide suite was attempted but did not complete within practical local runtime; no full-suite green result is claimed. The broader focused run's management benchmark/DNS failures reproduce on clean current dev.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.
  • Local CI is green.
  • Branch is on the latest dev.
  • Correct Codex and CodeRabbit findings are fixed.
  • Ready-for-review confirmation is present.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.
  • I pushed my PR to the latest dev commit.
  • I resolved all correct Codex and CodeRabbit findings.
  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a0d5899d-232f-4477-b9d3-8cf9b4a4fc9f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the intake: hygiene-blocked Deterministic PR hygiene checks failed label Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: src/server/auth-cors.ts.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 12, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (1/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 1/4).

Review readiness checklist

  • ⬜ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

1/4 boxes ticked.

This PR stays in draft until every box above is ticked.

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

The implementation and focused verification are green. The only blocked gate is the repository security-boundary rule because this PR touches src/server/auth-cors.ts for provider-management validation and the public provider DTO. This does not change request authentication, CORS admission, credentials, or secret handling. Please review this narrow change and apply the maintainer-sponsored label if acceptable; I am intentionally leaving the PR as a draft.

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

Rebased onto current dev@d5824814853eea68ceb4417403b22000a935cef8; new head is e12d917015c2. Post-rebase local proof is green: typecheck; service-tier/Chat 55 tests; catalog/registry 210 tests; router/policy 27 tests; focused management test 1 test; privacy scan; docs build (265 pages); and diff check. The remaining blocked checks are the repository security sponsorship gate for src/server/auth-cors.ts (provider-management validation/public DTO only). Please review this narrow boundary change and apply maintainer-sponsored if acceptable; I am intentionally keeping the PR Draft.

@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/fix-1436-service-tier branch from e12d917 to 15e1734 Compare August 12, 2026 08:55
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

Rebased and force-with-lease pushed onto current dev@cbbfdd8773e68a5dc2391ddeb32f33a225373c1a; new head is 15e1734. Fresh local proof: capability/catalog/runtime focused suite 309/309, 1167 assertions; typecheck, privacy scan, and diff check passed. The only remaining repository gate is maintainer sponsorship for the narrow provider-management validation/public DTO change in src/server/auth-cors.ts; I am leaving the PR Draft and will not bypass that security-boundary rule.

@github-actions github-actions Bot removed the intake: hygiene-blocked Deterministic PR hygiene checks failed label Aug 12, 2026
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

The security-boundary gate is now addressed by a real scope split, not by weakening validation: commit moves the new service-tier validation and public DTO projection into , removes the two additions from , and keeps POST/PATCH validation plus projection behavior intact. The diff no longer changes the protected auth-cors file. Fresh proof after the split: capability management projection/validation and persistence tests pass; related catalog/runtime/Chat tests 229/229; typecheck, privacy scan, and diff check pass. Please let hygiene/enforce-target rerun and review the new management-only module.

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

The security-boundary gate is now addressed by a real scope split, not by weakening validation: commit 5224f1a3ff38 moves the new service-tier validation and public DTO projection into src/server/management/provider-capability-config.ts, removes the two additions from src/server/auth-cors.ts, and keeps POST/PATCH validation plus /api/config projection behavior intact. The diff no longer changes the protected auth-cors file.

Fresh proof after the split: capability management projection/validation and persistence tests pass; related catalog/runtime/Chat tests 229/229; typecheck, privacy scan, and diff check pass. Please let hygiene/enforce-target rerun and review the new management-only module.

@Ingwannu

Copy link
Copy Markdown
Owner

Initial maintainer review on exact head 5224f1a3ff38e1686c45516ade57ec42b89235af.

The scope split out of auth-cors.ts is the right direction, and the core design is more coherent than landing #1512 alone: one exact provider/model capability decision controls catalog Fast metadata, global Fast injection, caller-selected tier preservation, and unsupported-tier stripping. Exact model IDs remain provider-scoped, and provider-level false remains fail-closed.

I am keeping this draft pending deeper review and executed exact-head CI. Please do not merge yet. The next review must verify at least these boundaries:

  • an unclassified route preserves an explicit caller tier but never receives global Fast injection or catalog Fast metadata;
  • model adapter overrides cannot publish Fast for a non-OpenAI-compatible wire;
  • provider-level false cannot be reopened by an exact-model true;
  • management PATCH merge/clear behavior cannot leak a capability across providers or inherited object keys;
  • combo intersection and custom-model projection use the same exact resolved model identity;
  • a selected Fast tier cannot be advertised without being forwarded by the eventual adapter.

If those checks hold on current dev and full CI is green, this is the preferred integration candidate and #1512 should close as superseded. No maintainer sponsorship label is needed now that the protected auth/CORS file is no longer changed.

Copy link
Copy Markdown
Contributor Author

Updated exact head: c6c0c9827702ef59b7de4f9c8bc1fd9443823ac6.

The runtime follow-up now uses the same final model/wire capability decision as catalog projection: explicit caller tiers are preserved only when the final adapter can forward them, and stripped fail-closed for provider/model denial or a non-service-tier adapter. Provider-level false remains authoritative.

Fresh local proof on this exact head: 230 focused catalog/runtime/Chat tests passed, 879 assertions; management scope-split proof was 2 tests/26 assertions; typecheck, privacy scan, diff check, and the 265-page docs build passed. The PR remains Draft for exact-head CI and the requested maintainer review.

@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/fix-1436-service-tier branch from c6c0c98 to fcd9126 Compare August 12, 2026 10:57

Yuxin-Qiao commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by the final current-dev update below. The authoritative candidate is now based on dev@59da369f1aba7996c518a72ff6c3add04aa2cedb at head 2a9c48d21; the earlier 84c012243/fcd912638 note is retained only as historical progress.

@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/fix-1436-service-tier branch from fcd9126 to 2a9c48d Compare August 12, 2026 11:01

Copy link
Copy Markdown
Contributor Author

Final current-dev rebase completed after correcting the upstream base pointer.

Base: dev@59da369f1aba7996c518a72ff6c3add04aa2cedb
Head: 2a9c48d21
Post-rebase service-tier/OpenAI proof remains 56 passed / 0 failed / 100 assertions; typecheck, privacy scan, and diff check passed. Keeping Draft for the maintainer's six boundary checks and automatic CI.

@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/fix-1436-service-tier branch from 2a9c48d to 7782d82 Compare August 12, 2026 11:09

Copy link
Copy Markdown
Contributor Author

Current exact-head handoff: rebased onto upstream dev@abe82212a7983cb5b5e97d94e958843068303241 and force-with-lease pushed as 7782d82d8.

Post-rebase proof: service-tier/OpenAI focused tests 56 passed, 0 failed, 100 assertions; typecheck, privacy scan, and diff check passed. Please run exact-head CI and the six requested capability-boundary checks; keeping Draft.

@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/fix-1436-service-tier branch from 7782d82 to 1ed3788 Compare August 12, 2026 11:13

Copy link
Copy Markdown
Contributor Author

Final exact-head update: upstream dev@4e0ffb2cbef0d3724a3aa9ebef26279aed44b694, fork head 1ed378812.

The final rebase proof is 56/56 service-tier/OpenAI tests, 100 assertions, plus typecheck, privacy scan, and diff check. Please review the six capability boundaries and run exact-head CI; Draft remains intentional.

Copy link
Copy Markdown
Contributor Author

Final exact-head gate status: 1ed378812 is based on dev@4e0ffb2cbef0d3724a3aa9ebef26279aed44b694; enforce-target, hygiene, label, and resolve-pr all pass. Local service-tier/OpenAI proof remains 56/56 with 100 assertions plus typecheck/privacy/diff. The PR remains Draft pending maintainer review and readiness confirmation.

Copy link
Copy Markdown
Contributor Author

@lidge-jun Reviewer-request API is unavailable to the fork author (403), so this is the explicit handoff instead. Final head 1ed378812 is based on dev@4e0ffb2cb; enforce-target/hygiene/label/resolve-pr pass, and the service-tier/OpenAI matrix is 56/56. Please review the six capability boundaries and decide readiness.

@Yuxin-Qiao
Yuxin-Qiao force-pushed the codex/fix-1436-service-tier branch from 1ed3788 to b1bebc0 Compare August 12, 2026 11:35

Copy link
Copy Markdown
Contributor Author

Current exact-head handoff after the latest upstream rebase:

  • Base: dev@567a6d4ffe6a7d7b341b5cc11e736081e1bb4522
  • Head: b1bebc059482f06b9e1e8be3aeaf2bb7902b1685
  • Service-tier/OpenAI focused matrix: 56 passed, 0 failed, 100 assertions.
  • bun run typecheck, bun run privacy:scan, and git diff --check origin/dev...HEAD: passed.
  • GitHub enforce-target, hygiene, label, and resolve-pr: passed.

The PR remains Draft because the requested independent maintainer review and readiness confirmation are still pending. Please review this exact head against the six capability boundaries listed in the earlier review; #1512 remains the fallback until this candidate is accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants